// pages/share/share.js

const app = getApp()
Page({

  /**
   * 页面的初始数据
   */
  data: {
    sharedData: null,
    loadingHidden: false,
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    var that = this;
    var intervalId = setInterval(function () {
      if (that.data.sharedData == null) {
        that.setData({
          sharedData: app.globalData.homeData
        });
      } else {
        that.setData({
          loadingHidden: true
        });
        clearInterval(intervalId);
      }
    }, 300);
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  tapShareButton: function(){
    console.log('onShareAppMessage');
    this.onShareAppMessage();
  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
    return {
      title: '一起走Pro',
      desc: '快来和我走路赢奖金吧!',
      path: '/pages/index/index',
      imageUrl: '/images/shareImage.png'
    }
  }
})